package mop.domain.task;

import mop.exception.IllegalTerminationException;

/**
 * A class that describes an object that can be terminated
 *  is to be inherited by all terminatable objects
 *
 * @invar none, terminated is a boolean, you'd have to be a genius to invent invar going with that
 */
public interface Terminatable 
{

	/**********************************************************
	* terminated
	**********************************************************/
	 
	
	/**
	 * returns the terminated flag
	 */
	public boolean isTerminated();
	
	/**
	 * Check whether this item can be deleted
	 * 
	 * @return gives back a true flag if it hasn't been terminated already
	 */
	public boolean canBeTerminated();

	/**
	 * Terminate this item.
	 * 
     * @post This item is terminated.
     *       | new.isTerminated()
     *         
	 * @throws IllegalTerminationException 
	 * 		   This item can not be terminated
	 * 		   | ! canBeTerminated()
	 */
	public void terminate() throws IllegalTerminationException;
	

	/**
	 * Check whether this item can have the given terminated-state
	 * as ist terminated-state.
	 * 
	 * @param terminatedState
	 *        The terminated-state to check.
	 *        
	 * @return True if this item is not terminated, or if the given
	 *         terminated-state is true. 
	 *         | !isTerminated || terminatedState
	 */
	//public boolean canHaveAsTerminationState(boolean terminatedState);

}